// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import VueResource from 'vue-resource'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueTouchKeyboard from 'vue-touch-keyboard'
import 'vue-touch-keyboard/dist/vue-touch-keyboard.css' // load default style
import VueQuillEditor from 'vue-quill-editor'
import api from './api'
import jQuery from 'jquery'

Vue.use(VueResource)
Vue.use(VueQuillEditor)
Vue.use(VueTouchKeyboard)
Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.prototype.$api = api
Vue.prototype.$jQuery = jQuery
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
// 清除定时器
router.beforeEach((to, from, next) => {
 // console.log(from)
  if (from.fullPath === '/hall/list') {
    let id = window.localStorage.getItem('setInterval_id')
    clearInterval(id)
    next()
  } else {
    next()
  }
})
